package cn.zh.npro.Activity;

import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;

import cn.zh.npro.R;

public class MCdetail extends BaseActivity {

    EditText edit;
    ImageView txter;
    ImageView back;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mcdetail);
        initmcd();
        }

    public void initmcd(){
        edit=findViewById(R.id.edit);
        txter=findViewById(R.id.txter);
        back=findViewById(R.id.back);
        back.setOnClickListener(this);
        edit.addTextChangedListener(new TextWatcher() {
            @Override
            public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
            }
            @Override
            public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
            }
            @Override
            public void afterTextChanged(Editable editable) {
                if (0==editable.length()){
                    txter.setVisibility(View.GONE);
                }else {
                    txter.setVisibility(View.VISIBLE);
                }
               }
            });
           }

    @Override
    public void onClick(View view) {
        super.onClick(view);
        int id=view.getId();
        switch (id){
            case R.id.back:
                finish();
                break;

        }
    }
}
